<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class DataUserVisitTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('data_user_visit', function(Blueprint $table) {
            $table->increments('id')->comment('自增id');
            $table->string('ref_date')->nullable()->comment('时间');
            $table->timestamp('ref_time')->nullable()->comment('时间');
            $table->integer('session_cnt')->default(0)->comment('打开次数');
            $table->integer('visit_pv')->default(0)->comment('访问次数');
            $table->integer('visit_uv')->default(0)->comment('访问人数');
            $table->integer('visit_uv_new')->default(0)->comment('新用户人数');
            $table->float('stay_time_uv')->default(0)->comment('人均停留时长');
            $table->float('stay_time_session')->default(0)->comment('次均停留时长');
            $table->float('visit_depth')->default(0)->comment('平均访问深度');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
